package com.example.score.service;

import com.example.score.entity.TUser;
import com.example.score.entity.Teaclass;
import com.example.score.entity.Teaclassuser;
import com.example.score.entity.major;
import com.example.score.entity.vo.TUserVo;
import com.example.score.entity.vo.TUserVos;
import com.example.score.mapper.TeaclassuserMapper;
//import com.sun.org.apache.bcel.internal.generic.RET;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class TeaclassuserService {
    @Resource
    private TeaclassuserMapper teaclassuserMapper;
    public int inserts(List<Teaclassuser> list) {
        return teaclassuserMapper.inserts(list);
    }
    public int insertbyex(List<Teaclassuser> list) {
        return teaclassuserMapper.insertbyex(list);
    }
    public int deleteMembers(List<Integer> list) {
        return teaclassuserMapper.deleteMembers(list);
    }
    public List<Integer> selectExits(Integer classId) {
        return teaclassuserMapper.selectExits(classId);
    }

    public List<TUserVo> selectAttribute(Integer nj,Integer zy, Integer bj){
        return teaclassuserMapper.selectAttribute(nj,zy,bj);
    }
    public List<TUserVos> getMembersByClassId(Integer classId) {
        return teaclassuserMapper.getMembersByClassId(classId);
    }
    public int clearByClassId(Integer classId) {
        return teaclassuserMapper.clearByClassId(classId);
    }

    public List<Teaclass> showAllClassList() {return teaclassuserMapper.showAllClassList();}

    public void importGradeStudent(Integer classId, Integer courseId){
        teaclassuserMapper.importGradeStudent(classId, courseId);
    }

    public void clearGradeStudent(Integer classId){
        teaclassuserMapper.clearGradeStudent(classId);
    }

    public List<Teaclass> RemainingClass() {return teaclassuserMapper.RemainingClass();}

    public int deleteClass(Integer classId){
        int del1 = teaclassuserMapper.deleteClass1(classId);
        int del2 = teaclassuserMapper.deleteClass2(classId);
        int del3 = teaclassuserMapper.deleteClass3(classId);
        int del4 = teaclassuserMapper.deleteClass4(classId);
        return del1;
    }

    public List<major> selectMajors(){
        return teaclassuserMapper.selectMajor();
    }

    public int addMajor(Integer major_id, String major_name)
    {
        return teaclassuserMapper.addMajor(major_id,major_name);
    }
    public int delMajor(List<Integer> lists)
    {
        System.out.println(888);
        System.out.println(lists);
        return teaclassuserMapper.delMajor(lists);
    }

    public List<TUserVo> selectUsers(String message){
        return teaclassuserMapper.selectUsers(message);
    }

}
